import request from '@/utils/request'
import de from "element-ui/src/locale/lang/de";

//查询申请单信息
export function getPayAudit(businessCode) {
  return request({
    url: '/prod-api/wechat/pay/audit/getPayAudit/'+businessCode,
    method: 'get',
  })
}

//新增主体信息
export function addSubjectInfo(data,businessCode) {
  return request({
    url: '/prod-api/wechat/pay/audit/addSubjectInfo/'+businessCode,
    method: 'post',
    data: data
  })
}

//新增经营资料
export function addBusinessInfo(data,businessCode) {
  return request({
    url: '/prod-api/wechat/pay/audit/addBusinessInfo/'+businessCode,
    method: 'post',
    data: data
  })
}

//新增结算规则
export function addSettlementInfo(data,businessCode) {
  return request({
    url: '/prod-api/wechat/pay/audit/addSettlementInfo/'+businessCode,
    method: 'post',
    data: data
  })
}

//新增结算银行账户
export function addBankAccountInfo(data,businessCode) {
  return request({
    url: '/prod-api/wechat/pay/audit/addBankAccountInfo/'+businessCode,
    method: 'post',
    data: data
  })
}

//新增超级管理员信息
export function addContactInfo(data,businessCode) {
  return request({
    url: '/prod-api/wechat/pay/audit/addContactInfo/'+businessCode,
    method: 'post',
    data: data
  })
}


//新增补充材料
export function addAdditionInfo(data,businessCode) {
  return request({
    url: '/prod-api/wechat/pay/audit/addAdditionInfo/'+businessCode,
    method: 'post',
    data: data
  })
}
//上传图片至微信
export function uploadingImg(file) {
  return request({
    url: '/prod-api/wechat/pay/audit/uploadingImg',
    method: 'post',
    data: file,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
    }
  })
}


//查询微信图片
export function getWachatImg(mediaIds) {
  return request({
    url: '/prod-api/wechat/pay/audit/getWachatImg/' + mediaIds,
    method: 'get',

  })
}

//查询地区信息
export function getWechatArea(addCitycode) {
  return request({
    url: '/prod-api/wechat/pay/audit/getWechatArea?addCitycode='+addCitycode,
    method: 'get'
  })
}

//查询上级地区信息
export function getAddCitycode(addCitycode) {
  return request({
    url: '/prod-api/wechat/pay/audit/getAddCitycode?addCitycode='+addCitycode,
    method: 'get'
  })
}

//修改主体信息
export function updatePayAuditType(data,businessCode) {
  return request({
    url: '/prod-api/wechat/pay/audit/updatePayAuditType/'+businessCode,
    method: 'post',
    data: data
  })
}

//新增支付授权单
export function addPayAudit(data,authorizerAppid) {
  return request({
    url: '/prod-api/wechat/pay/audit/addPayAudit/'+authorizerAppid,
    method: 'post',
    data: data
  })
}

//提交审核
export function submitAudit(businessCode) {
  return request({
    url: '/prod-api/wechat/pay/audit/submitAudit/'+businessCode,
    method: 'post',
  })
}

//查询经营资料
export function getBusinessInfo(businessCode) {
  return request({
    url: '/prod-api/wechat/pay/audit/getBusinessInfo/'+businessCode,
    method: 'get',
  })
}
//查询经营资料
export function getSubjectInfo(businessCode) {
  return request({
    url: '/prod-api/wechat/pay/audit/getSubjectInfo/'+businessCode,
    method: 'get'
  })
}

//查询结算规则
export function getSettlementInfo(businessCode) {
  return request({
    url: '/prod-api/wechat/pay/audit/getSettlementInfo/'+businessCode,
    method: 'get'
  })
}
//查询结算银行卡
export function getBankAccountInfo(businessCode) {
  return request({
    url: '/prod-api/wechat/pay/audit/getBankAccountInfo/'+businessCode,
    method: 'get'
  })
}

//查询超级管理员
export function getContactInfo(businessCode) {
  return request({
    url: '/prod-api/wechat/pay/audit/getContactInfo/'+businessCode,
    method: 'get'
  })
}
//查询授权单信息
export function getCommercialData(businessCode) {
  return request({
    url: '/prod-api/wechat/pay/audit/getCommercialData/'+businessCode,
    method: 'get',
  })
}

//查询商户信息
export function getAppId() {
  return request({
    url: '/prod-api/wechat/pay/audit/getAppId',
    method: 'get'
  })
}

//查询授权单列表
export function wechatPayAuditList(type) {
  return request({
    url: '/prod-api/wechat/pay/audit/wechatPayAuditList/'+type,
    method: 'get',
  })
}


//切换授权
export function switchPayAudit(data) {
  return request({
    url: '/prod-api/wechat/pay/audit/switchPayAudit',
    method: 'post',
    data:data
  })
}
